package org.rc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.rc.dto.SlpAddDto;
import org.rc.dto.SlpUpdateDto;

@Data
public class Slp {
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    private String name;
    private String mac;

    public static Slp getInstance(SlpAddDto slpAddDto){
        Slp slp = new Slp();
        slp.setName(slpAddDto.getName());
        slp.setMac(slpAddDto.getMac());
        return slp;
    }

    public static Slp getInstance(SlpUpdateDto slpUpdateDto){
        Slp slp = new Slp();
        slp.setId(slpUpdateDto.getId());
        slp.setName(slpUpdateDto.getName());
        slp.setMac(slpUpdateDto.getMac());
        return slp;
    }
}
